package main

import (
	"fmt"
	"time"
)

func firstUniqChar(s string) int {

	length := len(s)
	if length == 1 {
		return 0
	}
	// fmt.Println(s)

	// arrary := []byte{}
	// for i := 0; i < length; i++ {
	// 	arrary = append(arrary, s[i])
	// }

	// fmt.Println(arrary)
	f := false
	for i := 0; i < length; i++ {
		for j := 0; j < length; j++ {
			// fmt.Println(i, j)
			// fmt.Println(s[i], s[j])
			if i == j {
				continue
			}
			if s[i] == s[j] {
				f = false
				break
			} else {
				f = true
			}
		}
		if f == true {
			return i
		}
	}

	return -1

}

func main() {
	start := time.Now()
	num := 0
	s := "aabb"
	num = firstUniqChar(s)
	cost := time.Since(start)
	fmt.Println(num)
	fmt.Println(cost)

}
